Create a backup using a graph file
The easiest way to use fbackup is to create a file containing a list of files/directories to be backed up or excluded, this is known as a graph file. Files and directories to be included in the backup are proceeded by a letter "i", or a letter "e" for files to be excluded.
The example below will instruct fbackup to backup everything under root, except /tmp, /var/tmp and /savecore. See the fbackup man page for more information.
i /
e /tmp
e /var/tmp
e /savecore
To create a level 0 backup to /dev/rmt/0m using the graph file:
fbackup -0 -f /dev/rmt/0m -g graph_file
To create a level 0 backup on a tape drive on a remote system:
fbackup -0 -f server:/dev/rmt/0m -g graph_file
Create a backup without using a graph file
Create a level 0 backup of /usr, but exclude /usr/tmp. This example creates a file archive called "/backup/usr_fbackup.20020501":
fbackup -0 -f /backup/usr_fbackup.20020501 -i /usr -e /usr/tmp
Recover files from an fbackup archive (tape device or file)
List the contents of an fbackup archive and save the output to /restore/contents.txt:
frecover -I /restore/contents.txt -f archive
Use the following command to recover all files from an fbackup archive. Warning; this will restore to the absolute pathname, therefore do not use this command to restore into an alternative path.
frecover -r -f archive
Extract specific files (specified in a graph file) from an fbackup archive.
frecover -x -g graph_file -f archive
Recover a specific file from the archive (use absolute pathnames). In this example /tmp/file.txt is extracted:
frecover -x -i /tmp/file.txt -f archive
Recover a file to the current working directory (-X option). For example, to recover /tmp/file.txt to directory /restore you would perform the following:
cd /restore
frecover -X -x -i /tmp/file.txt -f archive
NOTE: The above command will create /restore/tmp/file.txt, i.e. it will create the leading directories as needed. Use the -F option to instruct frecover not to create leading directories.
The following commands would restore /tmp/file.txt as /restore/file.txt.
cd /restore
frecover -X -F -x -i /tmp/file.txt -f archive
Use the -N (no recover) option to preview a restore. This can be used to check your syntax without the risk of overwriting files. The -v option creates verbose output.
frecover -N -v -f archive
No comments:
Post a Comment